home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Kentucky Virtual Art Museum
/
Kentucky Virtual Art Museum.iso
/
site
/
museums
/
galleries
/
gallerySzekely.swf
/
scripts
/
FScrollBarSymbol.as
next >
Wrap
Text File
|
2005-08-29
|
14KB
|
383 lines
FScrollBarClass = function()
{
var _loc1_ = this;
if(_loc1_._height != 4)
{
_loc1_.init();
_loc1_.minPos = _loc1_.maxPos = _loc1_.pageSize = _loc1_.largeScroll = 0;
_loc1_.smallScroll = 1;
_loc1_.width = !_loc1_.horizontal ? _loc1_._height : _loc1_._width;
_loc1_._xscale = _loc1_._yscale = 100;
_loc1_.setScrollPosition(0);
_loc1_.tabEnabled = false;
if(_loc1_._targetInstanceName.length > 0)
{
_loc1_.setScrollTarget(_loc1_._parent[_loc1_._targetInstanceName]);
}
_loc1_.tabChildren = false;
_loc1_.setSize(_loc1_.width);
}
};
FScrollBarClass.prototype = new FUIComponentClass();
FScrollBarClass.prototype.setHorizontal = function(flag)
{
var _loc1_ = this;
var _loc2_ = flag;
if(_loc1_.horizontal && !_loc2_)
{
_loc1_._xscale = 100;
_loc1_._rotation = 0;
}
else if(_loc2_ && !_loc1_.horizontal)
{
_loc1_._xscale = -100;
_loc1_._rotation = -90;
}
_loc1_.horizontal = _loc2_;
};
FScrollBarClass.prototype.setScrollProperties = function(pSize, mnPos, mxPos)
{
var _loc1_ = this;
if(_loc1_.enable)
{
_loc1_.pageSize = pSize;
_loc1_.minPos = Math.max(mnPos,0);
_loc1_.maxPos = Math.max(mxPos,0);
_loc1_.scrollPosition = Math.max(_loc1_.minPos,_loc1_.scrollPosition);
_loc1_.scrollPosition = Math.min(_loc1_.maxPos,_loc1_.scrollPosition);
if(_loc1_.maxPos - _loc1_.minPos <= 0)
{
_loc1_.scrollThumb_mc.removeMovieClip();
_loc1_.upArrow_mc.gotoAndStop(3);
_loc1_.downArrow_mc.gotoAndStop(3);
_loc1_.downArrow_mc.onPress = _loc1_.downArrow_mc.onRelease = _loc1_.downArrow_mc.onDragOut = null;
_loc1_.upArrow_mc.onPress = _loc1_.upArrow_mc.onRelease = _loc1_.upArrow_mc.onDragOut = null;
_loc1_.scrollTrack_mc.onPress = _loc1_.scrollTrack_mc.onRelease = null;
_loc1_.scrollTrack_mc.onDragOut = _loc1_.scrollTrack_mc.onRollOut = null;
_loc1_.scrollTrack_mc.useHandCursor = false;
}
else
{
var _loc2_ = _loc1_.getScrollPosition();
_loc1_.upArrow_mc.gotoAndStop(1);
_loc1_.downArrow_mc.gotoAndStop(1);
_loc1_.upArrow_mc.onPress = _loc1_.upArrow_mc.onDragOver = _loc1_.startUpScroller;
_loc1_.upArrow_mc.onRelease = _loc1_.upArrow_mc.onDragOut = _loc1_.stopScrolling;
_loc1_.downArrow_mc.onPress = _loc1_.downArrow_mc.onDragOver = _loc1_.startDownScroller;
_loc1_.downArrow_mc.onRelease = _loc1_.downArrow_mc.onDragOut = _loc1_.stopScrolling;
_loc1_.scrollTrack_mc.onPress = _loc1_.scrollTrack_mc.onDragOver = _loc1_.startTrackScroller;
_loc1_.scrollTrack_mc.onRelease = _loc1_.stopScrolling;
_loc1_.scrollTrack_mc.onDragOut = _loc1_.stopScrolling;
_loc1_.scrollTrack_mc.onRollOut = _loc1_.stopScrolling;
_loc1_.scrollTrack_mc.useHandCursor = false;
_loc1_.attachMovie("ScrollThumb","scrollThumb_mc",3);
_loc1_.scrollThumb_mc._x = 0;
_loc1_.scrollThumb_mc._y = _loc1_.upArrow_mc._height;
_loc1_.scrollThumb_mc.onPress = _loc1_.startDragThumb;
_loc1_.scrollThumb_mc.controller = _loc1_;
_loc1_.scrollThumb_mc.onRelease = _loc1_.scrollThumb_mc.onReleaseOutside = _loc1_.stopDragThumb;
_loc1_.scrollThumb_mc.useHandCursor = false;
_loc1_.thumbHeight = _loc1_.pageSize / (_loc1_.maxPos - _loc1_.minPos + _loc1_.pageSize) * _loc1_.trackSize;
_loc1_.thumbMid_mc = _loc1_.scrollThumb_mc.mc_sliderMid;
_loc1_.thumbTop_mc = _loc1_.scrollThumb_mc.mc_sliderTop;
_loc1_.thumbBot_mc = _loc1_.scrollThumb_mc.mc_sliderBot;
_loc1_.thumbHeight = Math.max(_loc1_.thumbHeight,6);
_loc1_.midHeight = _loc1_.thumbHeight - _loc1_.thumbTop_mc._height - _loc1_.thumbBot_mc._height;
_loc1_.thumbMid_mc._yScale = _loc1_.midHeight * 100 / _loc1_.thumbMid_mc._height;
_loc1_.thumbMid_mc._y = _loc1_.thumbTop_mc._height;
_loc1_.thumbBot_mc._y = _loc1_.thumbTop_mc._height + _loc1_.midHeight;
_loc1_.scrollTop = _loc1_.scrollThumb_mc._y;
_loc1_.trackHeight = _loc1_.trackSize - _loc1_.thumbHeight;
_loc1_.scrollBot = _loc1_.trackHeight + _loc1_.scrollTop;
_loc2_ = Math.min(_loc2_,_loc1_.maxPos);
_loc1_.setScrollPosition(Math.max(_loc2_,_loc1_.minPos));
}
}
};
FScrollBarClass.prototype.getScrollPosition = function()
{
return this.scrollPosition;
};
FScrollBarClass.prototype.setScrollPosition = function(pos)
{
var _loc1_ = this;
var _loc2_ = pos;
_loc1_.scrollPosition = _loc2_;
if(_loc1_.scrollThumb_mc != undefined)
{
_loc2_ = Math.min(_loc2_,_loc1_.maxPos);
_loc2_ = Math.max(_loc2_,_loc1_.minPos);
}
_loc1_.scrollThumb_mc._y = (_loc2_ - _loc1_.minPos) * _loc1_.trackHeight / (_loc1_.maxPos - _loc1_.minPos) + _loc1_.scrollTop;
_loc1_.executeCallBack();
};
FScrollBarClass.prototype.setLargeScroll = function(lScroll)
{
this.largeScroll = lScroll;
};
FScrollBarClass.prototype.setSmallScroll = function(sScroll)
{
this.smallScroll = sScroll;
};
FScrollBarClass.prototype.setEnabled = function(enabledFlag)
{
var _loc1_ = this;
var _loc2_ = enabledFlag;
var _loc3_ = _loc1_.enable;
if(_loc2_ && !_loc3_)
{
_loc1_.enable = _loc2_;
if(_loc1_.textField != undefined)
{
_loc1_.setScrollTarget(_loc1_.textField);
}
else
{
_loc1_.setScrollProperties(_loc1_.pageSize,_loc1_.cachedMinPos,_loc1_.cachedMaxPos);
_loc1_.setScrollPosition(_loc1_.cachedPos);
}
_loc1_.clickFilter = undefined;
}
else if(!_loc2_ && _loc3_)
{
_loc1_.textField.removeListener(_loc1_);
_loc1_.cachedPos = _loc1_.getScrollPosition();
_loc1_.cachedMinPos = _loc1_.minPos;
_loc1_.cachedMaxPos = _loc1_.maxPos;
if(_loc1_.clickFilter == undefined)
{
_loc1_.setScrollProperties(_loc1_.pageSize,0,0);
}
else
{
_loc1_.clickFilter = true;
}
_loc1_.enable = _loc2_;
}
};
FScrollBarClass.prototype.setSize = function(hgt)
{
var _loc1_ = this;
if(_loc1_._height != 1)
{
_loc1_.width = hgt;
_loc1_.scrollTrack_mc._yscale = 100;
_loc1_.scrollTrack_mc._yscale = 100 * _loc1_.width / _loc1_.scrollTrack_mc._height;
if(_loc1_.upArrow_mc == undefined)
{
_loc1_.attachMovie("UpArrow","upArrow_mc",1);
_loc1_.attachMovie("DownArrow","downArrow_mc",2);
_loc1_.downArrow_mc.controller = _loc1_.upArrow_mc.controller = _loc1_;
_loc1_.upArrow_mc.useHandCursor = _loc1_.downArrow_mc.useHandCursor = false;
_loc1_.upArrow_mc._x = _loc1_.upArrow_mc._y = 0;
_loc1_.downArrow_mc._x = 0;
}
_loc1_.scrollTrack_mc.controller = _loc1_;
_loc1_.downArrow_mc._y = _loc1_.width - _loc1_.downArrow_mc._height;
_loc1_.trackSize = _loc1_.width - 2 * _loc1_.downArrow_mc._height;
if(_loc1_.textField != undefined)
{
_loc1_.onTextChanged();
}
else
{
_loc1_.setScrollProperties(_loc1_.pageSize,_loc1_.minPos,_loc1_.maxPos);
}
}
};
FScrollBarClass.prototype.scrollIt = function(inc, mode)
{
var _loc1_ = this;
var _loc3_ = _loc1_.smallScroll;
if(inc != "one")
{
_loc3_ = _loc1_.largeScroll != 0 ? _loc1_.largeScroll : _loc1_.pageSize;
}
var _loc2_ = _loc1_.getScrollPosition() + mode * _loc3_;
if(_loc2_ > _loc1_.maxPos)
{
_loc2_ = _loc1_.maxPos;
}
else if(_loc2_ < _loc1_.minPos)
{
_loc2_ = _loc1_.minPos;
}
_loc1_.setScrollPosition(_loc2_);
};
FScrollBarClass.prototype.startDragThumb = function()
{
var _loc1_ = this;
_loc1_.lastY = _loc1_._ymouse;
_loc1_.onMouseMove = _loc1_.controller.dragThumb;
};
FScrollBarClass.prototype.dragThumb = function()
{
var _loc1_ = this;
_loc1_.scrollMove = _loc1_._ymouse - _loc1_.la